package org.feiye.studyday27.thread;

public class Test1 {
	public static void main(String[] args) {
		Pmcraven pm1 = new Pmcraven("one");
		pm1.run();
		Pmcraven pm2 = new Pmcraven("two");
		pm2.run();
	}
}

class Pmcraven extends Thread {
	private String sTname = "";

	public Pmcraven(String sTname) {
		this.sTname = sTname;
	}

	public void run() {
		for (int i = 0; i < 2; i++) {
			try {
				sleep(1000);
			} catch (InterruptedException e) {

			}
			yield();
			System.out.println(sTname);
		}
	}
}
